package com.yunao.service.report;

public class StringUtil {
    public static final String VALIDATE_EMAIL = "^([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\\_|\\.]?)*[a-zA-Z0-9]+\\.[a-zA-Z]{2,3}$";
    public static final String VALIDATE_MOBILE = "^((\\(\\d{3}\\))|(\\d{3}\\-))?13[0-9]\\d{8}|15[0-9]\\d{8}|189\\d{8}|182\\d{8}$";
    /**
     * 自动报告类型
     */
    public static int getReportManner(String[] manners) {
        if (manners == null)
            return 0;
        int reportManner = 0;
        for (String manner : manners) {
            if ("daily".equals(manner))
                reportManner += 1;
            else if ("weekly".equals(manner))
                reportManner += 2;
            else if ("monthly".equals(manner))
                reportManner += 4;
        }
        return reportManner;
    }

}
